<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Axios异步通信</title>
</head>
<body>
<div id="app1">
    <p>{{result.name}}</p>
    <p>{{result.Schools[0].name}}</p>
</div>


<!-- 导入vue的包-->
<script src="https://cdn.jsdelivr.net/npm/vue@2.5.21/dist/vue.min.js"></script>
<!-- 导入axios的包-->
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>

<script>
    var vm = new Vue({
        el:"#app1",
        data(){
            return{
                result:{
                    name: null,
                    Schools: [
                        {
                            name: null,
                            address: null
                        },
                        {
                            name: null,
                            address: null
                        },
                        {
                            name: null,
                            address: null
                        }
                    ]
                }
            }
        },
        mounted(){
            axios.get("../data.json").then(msg=>{this.result=msg.data})
        }
    })
</script>
</body>
</html>